﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using GetInfoUser.ServiceReference1;
namespace GetInfoUser
{
    public partial class MainPage : UserControl
    {
        UserServiceClient service = new UserServiceClient();
        public MainPage()
        {
            InitializeComponent();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            service.GetInfoCompleted += (s, o) =>
            {
                if (o.Error != null)
                {
                    MessageBox.Show("loi");
                }
                else
                {
                    txtPhone.Text = o.Result.PHONE;
                    txtEmail.Text = o.Result.EMAIL;
                    txtFullName.Text = o.Result.TLFullName;
                    txtGroup.Text = o.Result.Group;
                    dtpNgay.SelectedDate = o.Result.ngay;
                    txtAddress.Text = o.Result.ADDRESS;
                    txtBrandName.Text = o.Result.BrandName;
                    
                }
            };
            service.GetInfoAsync("minhson.com",txtUsername.Text);
        }
    }
}
